package com.basic.backend.service.impl;

import com.basic.backend.model.entity.User;
import com.basic.backend.service.StpInterface;
import com.basic.backend.service.UserService;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

public class StpInterfaceImpl implements StpInterface {
    @Resource
    private UserService userService;

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        return Collections.emptyList();
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        User user = userService.getById(Long.parseLong(loginId.toString()));
        return Collections.singletonList(user.getUserRole());
    }
}